/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.peopleinformation.organization.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.peopleinformation.organization.entity.NameOfOrganization;
import com.jeeplus.modules.peopleinformation.organization.mapper.NameOfOrganizationMapper;

/**
 * organizationInformationService
 * @author 秦子洋
 * @version 2021-08-04
 */
@Service
@Transactional(readOnly = true)
public class NameOfOrganizationService extends TreeService<NameOfOrganizationMapper, NameOfOrganization> {

	public NameOfOrganization get(String id) {
		return super.get(id);
	}

	public List<NameOfOrganization> findList(NameOfOrganization nameOfOrganization) {
		if (StringUtils.isNotBlank(nameOfOrganization.getParentIds())){
			nameOfOrganization.setParentIds(","+nameOfOrganization.getParentIds()+",");
		}
		return super.findList(nameOfOrganization);
	}

	@Transactional(readOnly = false)
	public void save(NameOfOrganization nameOfOrganization) {
		super.save(nameOfOrganization);
	}

	@Transactional(readOnly = false)
	public void delete(NameOfOrganization nameOfOrganization) {
		super.delete(nameOfOrganization);
	}

}